<template>
    <van-swipe @change="onChange">
        <van-swipe-item v-for="img in imgList">
          <img class="w100" :src="img" alt="">
        </van-swipe-item>  

        <template #indicator>
            <div class="custom-indicator">{{ current + 1 }}/4</div>
        </template>
    </van-swipe>
</template>

<script>
export default {
  props: ['imgList'],

  data() {
    return {
      current: 0,
    };
  },
  methods: {
    onChange(index) {
      this.current = index;
    },
  },
};
</script>

<style>
.custom-indicator {
    position: absolute;
    right: 5px;
    bottom: 5px;
    padding: 2px 5px;
    font-size: 12px;
    background: rgba(0, 0, 0, 0.1);
}
</style>